#!/usr/bin/python
import sys
import random
first = int(sys.argv[1])
second = int(sys.argv[2])
for k in range(1):
  n_doors = first
  n_penguins = second 
  print n_doors,n_penguins
  for i in range(n_doors + n_penguins):
    x1 = random.randint(0,15000)
    y1 = random.randint(0,15000)
    x2 = random.randint(x1 + 1, 15001)
    y2 = random.randint(y1 + 1, 15001)
    print x1,y1,x2,y2

print 0,0
